import axios from 'axios'
import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/vue-element-admin/user/login',
    //url: '/api/Login',
    method: 'post',
    data,
    //baseURL:'http://localhost:3000/api'
  })
}

export function getInfo(token) {
  // return request({
  //   url: '/vue-element-admin/user/info',
  //   method: 'get',
  //   params: { token }
  // })
  return new Promise((resolve,reject)=>{
    resolve({
      code: 200,
      data: {
          roles: ['admin'],
          introduction: 'test',
          avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
          name: 'test'
        }
    })
  })
}

export function logout() {
  // return request({
  //   url: '/vue-element-admin/user/logout',
  //   method: 'post'
  // })
  return new Promise((resolve,reject)=>{
    resolve({
      code: 200,
      data: 'success'
    })
  })
}
